# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-cement
pkgname=('python2-cement' 'python-cement')
_pkgname=cement
pkgver=2.10.12
_pyver=3.13
pkgrel=11
epoch=1
pkgdesc='CLI Application Framework for Python.'
arch=('any')
url='https://pypi.org/project/cement/#files'
license=('BSD')
depends=('python')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('0c9384c2c9c5ece7e3ea3617a798a158e0e616431d1389f928242dd86c1e99e1897a15484b493ef29496c2417212d4e32273639624914ffd089e29578625f545')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-cement() {
  depends=('python2')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build

  rm -rf "$pkgdir/usr/lib/python2.7/site-packages/examples"
}

package_python-cement() {
  depends=('python')

  cd "$_pkgname-$pkgver"

  python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build

  rm -rf "$pkgdir/usr/lib/python$_pyver/site-packages/examples"
}

